package finally_demo;

public class FinallyDemo {
    static String test() {
        try {
            if(true)
                return "hello";
        } finally {
//            return "abc";
        }
        return null;
    }

    static int test2() {
        int a;
        try {
            a = 1;
            if(true)
                return a;
        } finally {
            a = 2;
        }
        a = 3;
        return a;
    }


    public static void main(String[] args) {
        System.out.println(test());
        System.out.println(test2());
    }
}
